home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / MWCC03 / EXAMPLES.ZIP / SFXDLGW.PAS < prev    next >
Pascal/Delphi Source File  |  1993-08-18  |  5KB  |  168 lines

  1. {**********************************************************************}
  2. {*                                                                    *}
  3. {*          Microworks Sample Application                                        *}
  4. {*                                                                    *}
  5. {*         for Borland Pascal v7.0 and Turbo Pascal for Windows v1.5           *}
  6. {*                                                                    *}
  7. {*     Copyright 1992-93 Jeff Franks (Microworks) Sydney, Australia.  *}
  8. {*                                                                    *}
  9. {*         You are free to use, modify, reproduce and distribute the      *}
  10. {*         Sample Files (and/or any modified version) in any way you      *}
  11. {*         find useful.                                                                *}
  12. {*                                                                    *}
  13. {**********************************************************************}
  14.  
  15. {*** Introduction
  16.  
  17.     Application    := Basic SFX DlgWindow
  18.  
  19.     Files          := SFXDlgW.pas, SFXDlgW.res
  20.  
  21.     Units Required := MObjects and MWCC.dll
  22.  
  23.     Tabs           := 2
  24.  
  25.     Screen         := 800 * 600
  26.  
  27.     Date           := August, 1993.
  28.  
  29.     The TSFXDlgWindow object does not support the use of standard menus (menu bars)
  30.     or TScroller scroll bars (ws_VScroll or ws_HScroll).
  31.  
  32.     Warning - Don't overide any inherited methods (not listed here) without first consulting
  33.               the documentation.
  34.  
  35. ***}
  36.  
  37. program SFXDlgW;
  38.  
  39. {$R SFXDlgW.res}
  40.  
  41. uses WinTypes, WinProcs, MObjects,
  42.          {$IFDEF Ver15}
  43.              WObjects;
  44.          {$ELSE}
  45.              Objects, OWindows, ODialogs;
  46.          {$ENDIF}
  47.  
  48. const
  49.  
  50.     AppName : PChar = 'NewSFXDlgWindow';
  51.  
  52. type
  53.  
  54.     PNewSFXApplication = ^TNewSFXApplication;
  55.     TNewSFXApplication = object(TApplication)
  56.         procedure InitMainWindow; virtual;
  57.     end;
  58.  
  59.     PNewSFXDlgWindow = ^TNewSFXDlgWindow;
  60.     TNewSFXDlgWindow = object(TSFXDlgWindow)
  61.         constructor Init(AParent: PWindowsObject; AName: PChar);
  62.         destructor Done; virtual;
  63.         function  GetClassName : PChar; virtual;
  64.         procedure GetWindowClass(var AWndClass: TWndClass); virtual;
  65.         procedure SetUpWindow; virtual;
  66.         procedure WMPaint (var Msg: TMessage); virtual wm_First + wm_Paint;
  67.         procedure WMNCPaint (var Msg: TMessage); virtual wm_First + wm_NCPaint;
  68.         procedure WMNCCalcSize (var Msg: TMessage); virtual wm_First + wm_NCCalcSize;
  69.         procedure WMCtlColor (var Msg: TMessage); virtual wm_First + wm_CtlColor;
  70.         procedure WMActivate (var Msg: TMessage); virtual wm_First + wm_Activate;
  71.         procedure WMNCActivate (var Msg: TMessage); virtual wm_First + wm_NCActivate;
  72.         procedure WMActivateApp (var Msg: TMessage); virtual wm_First + wm_ActivateApp;
  73.         procedure WMGetMinMaxInfo (var Msg: TMessage); virtual wm_First + wm_GetMinMaxInfo;
  74.     end;
  75.  
  76. {********** TNewSFXApplication **********}
  77.  
  78. procedure TNewSFXApplication.InitMainWindow;
  79. begin
  80.     MainWindow := New(PNewSFXDlgWindow, Init(nil, 'SFXDlgWindow'));
  81. end;
  82.  
  83. {********** TNewSFXDlgWindow **********}
  84.  
  85. constructor TNewSFXDlgWindow.Init(AParent: PWindowsObject; AName: PChar);
  86. begin
  87.     TSFXDlgWindow.Init(AParent, AName);
  88. end;
  89.  
  90. destructor TNewSFXDlgWindow.Done;
  91. begin
  92.     TSFXDlgWindow.Done;
  93. end;
  94.  
  95. function TNewSFXDlgWindow.GetClassName;
  96. begin
  97.     GetClassName := AppName;
  98. end;
  99.  
  100. procedure TNewSFXDlgWindow.GetWindowClass(var AWndClass: TWndClass);
  101. begin
  102.     TSFXDlgWindow.GetWindowClass(AWndClass);
  103. end;
  104.  
  105. procedure TNewSFXDlgWindow.SetUpWindow;
  106. var
  107.     X, Y, W, H: Integer;
  108. begin
  109.     TSFXDlgWindow.SetUpWindow;
  110.     X := GetSystemMetrics(sm_CXScreen) div 4;
  111.     Y := GetSystemMetrics(sm_CYScreen) div 4;
  112.     W := GetSystemMetrics(sm_CXScreen) div 2;
  113.     H := GetSystemMetrics(sm_CYScreen) div 2;
  114.     MoveWindow(HWindow, X, Y, W, H, True);
  115.     SetWindowText(Hwindow, 'SpecialFX DlgWindow');
  116. end;
  117.  
  118. procedure TNewSFXDlgWindow.WMPaint (var Msg: TMessage);
  119. begin
  120.     TSFXDlgWindow.WMPaint(Msg);
  121. end;
  122.  
  123. procedure TNewSFXDlgWindow.WMNCPaint (var Msg: TMessage);
  124. begin
  125.     TSFXDlgWindow.WMNCPaint(Msg);
  126. end;
  127.  
  128. procedure TNewSFXDlgWindow.WMNCCalcSize (var Msg: TMessage);
  129. begin
  130.     TSFXDlgWindow.WMNCCalcSize(Msg);
  131. end;
  132.  
  133. procedure TNewSFXDlgWindow.WMCtlColor (var Msg: TMessage);
  134. begin
  135.     TSFXDlgWindow.WMCtlColor(Msg);
  136. end;
  137.  
  138. procedure TNewSFXDlgWindow.WMActivate (var Msg: TMessage);
  139. begin
  140.     TSFXDlgWindow.WMActivate(Msg);
  141. end;
  142.  
  143. procedure TNewSFXDlgWindow.WMNCActivate (var Msg: TMessage);
  144. begin
  145.     TSFXDlgWindow.WMNCActivate(Msg);
  146. end;
  147.  
  148. procedure TNewSFXDlgWindow.WMActivateApp (var Msg: TMessage);
  149. begin
  150.     TSFXDlgWindow.WMNCActivate(Msg);
  151. end;
  152.  
  153. procedure TNewSFXDlgWindow.WMGetMinMaxInfo (var Msg: TMessage);
  154. begin
  155.     TSFXDlgWindow.WMGetMinMaxInfo(Msg);
  156. end;
  157.  
  158. {********** Main program **********}
  159.  
  160. var
  161.     SFXApp: TNewSFXApplication;
  162. begin
  163.  
  164.     SFXApp.Init(AppName);
  165.     SFXApp.Run;
  166.     SFXApp.Done;
  167. end.
  168.